Global Index
HTML5 JS API Index > DOM Tutorials & Specs

Range

Range objects are simply known as ranges.

Properties
const unsigned shortEND_TO_END = 2
const unsigned shortEND_TO_START = 3
const unsigned shortSTART_TO_END = 1
const unsigned shortSTART_TO_START = 0
boolean
collapsed
The collapsed attribute must return true if start is the same as end, and false otherwise.
NodecommonAncestorContainer
Node
endContainer
The endContainer attribute must return the end node.
unsigned long
endOffset
The endOffset attribute must return the end offset.
Node
startContainer
The startContainer attribute must return the start node.
unsigned long
startOffset
The startOffset attribute must return the start offset.
Constructor
Range()
Operations
DocumentFragment
cloneContents()
The cloneContents() method must return the result of cloning context object.
Range
cloneRange()
The cloneRange() method must return a new range with the same start and end as the context object.
void
collapse(optional boolean toStart)
The collapse(toStart) method must if toStart is true, set end to start, and set start to end otherwise.
shortcompareBoundaryPoints(unsigned short how, Range sourceRange)
shortcomparePoint(Node node, unsigned long offset)
voiddeleteContents()
void
detach()
The detach() method must do nothing. Its functionality (disabling a Range object) was removed, but the method itself is preserved for compatibility.
DocumentFragment
extractContents()
The extractContents() method must return the result of extracting context object.
void
insertNode(Node node)
The insertNode(node) method must insert node into context object.
booleanintersectsNode(Node node)
booleanisPointInRange(Node node, unsigned long offset)
void
selectNode(Node node)
The selectNode(node) method must select node within context object.
voidselectNodeContents(Node node)
void
setEnd(Node node, unsigned long offset)
The setEnd(node, offset) method must set the end of the context object to boundary point (node, offset).
voidsetEndAfter(Node node)
voidsetEndBefore(Node node)
void
setStart(Node node, unsigned long offset)
The setStart(node, offset) method must set the start of the context object to boundary point (node, offset).
voidsetStartAfter(Node node)
voidsetStartBefore(Node node)
voidsurroundContents(Node newParent)
Referenced by
DocumentcreateRange()